home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / jazlib.arc / JZCRTFIL.C < prev    next >
Text File  |  1988-12-18  |  652b  |  31 lines

  1. /*
  2. ┌────────────────────────────────────────────────────────────────────────────┐
  3. │jzcrtfil.c                                     │
  4. │Create a file, given it's "handle".                                         │
  5. │                                         │
  6. └────────────────────────────────────────────────────────────────────────────┘
  7. */
  8.  
  9. #include <jaz.h>
  10.  
  11. jzcrtfil(fname,fattr)
  12. char *fname;
  13. int fattr;              /* attribute to create file with */
  14. {
  15.   TREG wreg;
  16.  
  17.   wreg.x.ds = getds();
  18.   wreg.x.dx = (int) fname;
  19.   wreg.x.cx = fattr;
  20.  
  21.   wreg.h.ah = 0x3C;           /* create file function */
  22.  
  23.   msdos(&wreg);
  24.  
  25.   if (wreg.x.flags & 1)
  26.     return(-1);
  27.   else
  28.     return(wreg.x.ax);
  29.  
  30. }
  31.